const ajax = window.ajaxFlowApi;

export let tagList = (params) => {
    return ajax.request('/v1/business/tag/list', 'post', params, {
        showLoading: true
    });
};
// 新增
export let tagCreate = (params = {}) => {
    return ajax.request('/v1/business/tag', 'post', params, {
        showLoading: true
    });
};
// 删除/v1/business/tag/{primaryKey}
export let tagDelete = (primaryKey) => {
    if (!primaryKey) {
        this.$message.error('删除失败！参数缺失');
        return false;
    }
    return ajax.request(`/business/tag/${primaryKey}`, 'delete', {}, {
        showLoading: true
    });
};

///v1/business/tag/map   标签关系  新增
export let tagCreateChain = (params = {}) => {
    return ajax.request('/v1/business/tag/map', 'post', params, {
        showLoading: true
    });
};
// /v1/business/tag/map/list 列表
export let tagListChain = (params) => {
    return ajax.request('/v1/business/tag/map/list', 'post', params, {
        showLoading: true
    });
};
// /v1/business/tag/map/{primaryKey}  删除
export let tagDeleteChain = (primaryKey) => {
    if (!primaryKey) {
        this.$message.error('删除失败！参数缺失');
        return false;
    }
    return ajax.request(`/business/tag/map/${primaryKey}`, 'delete', {}, {
        showLoading: true
    });
};